<html>
    <?
    include 'web/header.phtml';
    ?>

    <body>

        <?
        include 'web/body.header.phtml';
        include 'web/body.menu.phtml';
        ?>

        <div id="page">

            <?
            include 'web/body.banner.phtml';
            ?>
            <input type='button'value='Add new' onclick=addNewAccountForm() style='width:60px'/>
            <?=$MSS?>
            <div style="clear: both; margin-bottom: 20px;"></div>
            
            <div id="accountForm" class="AccountTable">
                <form name="addAccount" action="admin.php?view=account" method="post"  enctype="multipart/form-data" onsubmit="return ValidateForm();">
                    <input type="hidden" name="view" value="Account" />
                    <table>
                        <tr>
                            <td>Account:</td><td>
                            <input type="text" name="Account" id="Account" onblur=checkAccount() size=50 maxlength=200>
                            <label id="checkaccount"></label></td>
                        </tr>
                        <tr>
                            <td>Password:</td><td>
                            <input type="text" name="Password" id="Password" size=50 maxlength=200>
                            </td>
                        </tr>
                        <tr>
                            <td>Name:</td><td>
                            <input type="text" name="Name" id="Name" size=50 maxlength=200>
                            </td>
                        </tr>
                        <tr>
                            <td>Email:</td><td>
                            <input type="text" name="Email" id="Email" size=50 maxlength=200>
                            </td>
                        </tr>

                        <tr>
                            <td>Birthday:</td>
                            <td>
                            <input type="text" name="Birthday" id="Birthday" size=50 maxlength=200>
                            </td>
                        </tr>
                        <tr>
                            <td>Role:</td>
                            <td>
                            <select name="Role">
                            	<option value="User">User</option>
                            	<option value="Admin">Admin</option>                            	
                            </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Address:</td>
                            <td>                            <textarea id="Address" name="Address" cols="50" rows="5" style="width:335px"></textarea></td>
                        </tr>
                        <tr>
                            <td>Phone:</td>
                            <td>
                            <input type="text" name="Phone" id="Phone" size=50 maxlength=200>
                            </td>
                        </tr>
                        <tr>
                            <td>About:</td>
                            <td>                            <textarea id="About" name="About" cols="50" rows="5" style="width:335px"></textarea></td>
                        </tr>
                       
                        <tr>
                            <td colspan="2" align="right">
                            <input type="submit" value="Add" id="btnSubmit" name="Submit"/>
                            <input type="submit" value="Modify" name="Submit"/>
                            <input type="reset" value="Reset" name="Clear">
                            </td>

                        </tr>
                    </table>

                </form>
            </div>
            <div class="AccountTable">
                <?echo $PageLink?>
                <!-- start content -- -->
                <table>

                    <?php
                    if (count($Accounts) > 0) {
                        echo "<thead>
<tr>
<th>Account</th>
<th>Name</th>
<th>Email</th>
<th>Birthday</th>
<th>Role</th>
<th>Address</th>
<th>Phone</th>
<th>About</th>
<th>Operation</th>
</tr>
</thead>";
                        foreach ($Accounts as $Account) {
                            echo "<tr>
<td>$Account[Account]</td>
<td>$Account[Name]</td>
<td>$Account[Email]</td>
<td>$Account[Birthday]</td>
<td>$Account[Role]</td>
<td>$Account[Address]</td>
<td>$Account[Phone]</td>
<td>$Account[About]</td>
<td><input type='button'value='Select' onclick=selectAccount('" . $Account[Account] . "') style='width:60px'/>
<button onclick=deleteAccount($Account[Account])>Delete</button></td>
</tr>";
                        }
                    }
                    ?>
                </table>
            </div>
            
            <!-- end content -- -->
        </div>

        <?
        include 'web/body.wrapper.phtml';
        ?>
    </body>
</html>

